<?php
  /*$district = array();
  for ($i = 0; $i < count($node->field_src_dist); $i++) {
    $district[] = $node->field_src_dist[$i]['view'];
  }
  $url = l($node->field_src_website[0]['view'], $node->field_src_website[0]['view'], 
                                              array('attributes' => array('target' => '_blank')));
	*/                                              
  global $base_url;
  
  $link = $base_url . '/' . drupal_get_path('theme', 'nic');
  
  
?>
<?php
// $Id: node.tpl.php,v 1.5 2007/10/11 09:51:29 goba Exp $
?>

	
<div id="node-<?php print $node->nid; ?>" class="">

<?php //print $picture ?>

<?php if ($page == 0): ?>
  <h2><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>
<?php endif; ?>

  <!--  <?php if ($submitted): ?>
    <span class="submitted"><?php print $submitted; ?></span>
  <?php endif; ?>-->
<div class ="node_view_heading">
	<div class ="node_view_head_content">
		<img height="15" width="15" style="display: none;" class="node_view_top_corner" alt="" src=<?php print $link . "/images/leftcurve.jpg" ?>>
		<span class = "node_view_head_title"><br/><?php echo t('Scheme');?></span>
	</div>
</div>
<?php if($node->field_scheme_concern_department['und'][0]['value']){ ?>
<div class = "node_viewlist_even">
	<span class = "left_column"><?php echo t('Concerned Department');?></span>
	<span class = "middle_column"> : </span>
	<span class = "right_column"><?php  echo get_dept_name($node->field_scheme_concern_department['und'][0]['value']);  ?></span>
	<div class="clr"></div>
</div>
<?php }
/*
if(get_array_value($node->field_scheme_concern_district)){
?>
<div class = "node_viewlist_odd">
	<span class = "left_column"><?php echo t('Concerned District');?></span>
	<span class = "middle_column"> : </span>
	<span class = "right_column"><?php echo get_array_value($node->field_scheme_concern_district);?></span>
	<div class="clr"></div>
</div>
<?php } */
if(get_orgn_name($node->field_scheme_org['und'][0]['value'])){?>
<div class = "node_viewlist_even">
	<span class = "left_column"><?php echo t('Organisation Name');?></span>
	<span class = "middle_column"> : </span>
	<span class = "right_column"><?php  echo get_orgn_name($node->field_scheme_org['und'][0]['value']); ?></span>
	<div class="clr"></div>
</div>	
<?php } ?>



	
	
	
<div class = "node_viewlist_odd">
	<span class = "left_column"><?php echo t('Scheme Details');?></span>
	
	<div class="clr"></div>
</div>

<div class = "node_viewlist_odd">
	<span class = "left_column"><?php echo t('Concerned District') ?></span>
	<span class = "middle_column"> : </span>
	<span class = "right_column"><?php echo get_dist_name($node->field_anndist['und'][0]['value']); ?></span>
	<div class="clr"></div>
</div>


<div class = "node_viewlist_odd">
	<span class = "left_column"><span class="whitespace"></span><?php echo t('Title / Name');?>:</span>
	<span class = "middle_column"> : </span>
	<span class = "right_column"><?php  echo  $title ?></span>
	<div class="clr"></div>
</div>

<?php if($node->field_scheme_associate['und'][0]['value']) { ?>
<div class = "node_viewlist_odd">
	<span class = "left_column"><span class="whitespace"></span><?php echo t('Associated Scheme');?></span>
	<span class = "middle_column"> : </span>
	<span class = "right_column"><?php echo $node->field_scheme_associate['und'][0]['value'];?></span>
	<div class="clr"></div>
</div>
<?php } 

if ($node->field_scheme_sponsored_by['und'][0]['value']){?>
<div class = "node_viewlist_odd">
	<span class = "left_column"><span class="whitespace"></span><?php echo t('Sponsored By');?></span>
	<span class = "middle_column"> : </span>
	<span class = "right_column"><?php  echo get_scheme_sponsors($node->field_scheme_sponsored_by['und'][0]['value']); ?></span>
	<div class="clr"></div>
</div>

<?php
}	
if($node->field_scheme_funding_pattern['und'][0]['value']){
?>
<div class = "node_viewlist_odd">
	<span class = "left_column"><span class="whitespace"></span><?php echo t('Funding Pattern');?></span>
	<span class = "middle_column"> : </span>
	<span class = "right_column"><?php echo get_value($node->field_scheme_funding_pattern['und'][0]['value']); ?></span>
	<div class="clr"></div>
</div>
<?php }?>

<div class = "node_viewlist_even">
	<span class = "left_column"><?php echo t('Beneficiaries');?></span>
	<span class = "middle_column"> : </span>
	<span class = "right_column"><?php echo get_scheme_beneficiaries($node->field_scheme_beneficiaries['und'][0]['value']);  ?></span>
	<div class="clr"></div>
</div>
<div class = "node_viewlist_odd">
	<span class = "left_column"><?php echo t('Benefits Types');?></span>
	<span class = "middle_column"> : </span>
	<span class = "right_column"><?php echo get_scheme_benefits($node->field_scheme_benfits_type['und'][0]['value']);  ?></span>
	<div class="clr"></div>
</div>
<div class = "node_viewlist_even">
	<span class = "left_column"><?php echo t('Eligibility criteria');?></span>
	
	<div class="clr"></div>
</div>
<div class = "node_viewlist_even">
	<span class = "left_column"><span class="whitespace"></span><?php echo t('Income');?></span>
	<span class = "middle_column"> : </span>
	<span class = "right_column"><?php echo get_value($node->field_scheme_eligible_income['und'][0]['value']); ?></span>
	<div class="clr"></div>
</div>

<div class = "node_viewlist_even">
	<span class = "left_column"><span class="whitespace"></span><?php echo t('Age');?></span>
	<span class = "middle_column"> : </span>
	<span class = "right_column"><?php echo get_value($node->field_scheme_eligible_age_from['und'][0]['value']); ?> To <?php echo get_value($node->field_scheme_eligible_age_to['und'][0]['value']); ?></span>
	<div class="clr"></div>
</div>

<?php 
$cmdyVal = get_community_mst($node->field_scheme_eligible_community['und'][0]['value']);

if($cmdyVal!='Please select a community') { ?>
<div class = "node_viewlist_even">
	<span class = "left_column"><span class="whitespace"></span><?php echo t('Community');?></span>
	<span class = "middle_column"> : </span>
	<span class = "right_column"><?php echo $cmdyVal;  ?></span>
	<div class="clr"></div>
<?php } ?>	

</div>
<div class = "node_viewlist_even">
	<span class = "left_column"><span class="whitespace"></span><?php echo t('Other Details');?></span>
	<span class = "middle_column"> : </span>
	<span class = "right_column"><?php echo get_value($node->field_scheme_eligibility['und'][0]['value']);  ?></span>
	<div class="clr"></div>
</div>

 
<div class = "node_viewlist_odd">
	<span class = "left_column"><?php echo t('How To Avail');?></span>
	<span class = "middle_column"> : </span>
	<span class = "right_column"><?php print get_value($node->field_scheme_how_to_avail['und'][0]['value']);?></span>
	<div class="clr"></div>
</div>
<div class = "node_viewlist_even">
	<span class = "left_column"><?php echo t('Validity of the Scheme');?> </span>
	
	<div class="clr"></div>
</div>
<div class = "node_viewlist_even">
	<span class = "left_column"><span class="whitespace"></span><?php echo t('Introduced On');?></span>
	<span class = "middle_column"> : </span>
	<span class = "right_column"><?php $node->field_scheme_introduced_on['und'][0]['value'] ? print date('d-m-Y',strtotime($node->field_scheme_introduced_on['und'][0]['value'])) : print '--'; ?></span>
	<div class="clr"></div>
</div>
<div class = "node_viewlist_even">
	<span class = "left_column"><span class="whitespace"></span><?php echo t('Valid Upto');?></span>
	<span class = "middle_column"> : </span>
	<span class = "right_column"><?php print format_date($node->scheduler['unpublish_on'], 'custom', 'd-m-Y'); ?> 
	<?php echo $diff_str; ?></span>
	<div class="clr"></div>
</div>

 

<div class = "node_viewlist_even">
	<span class = "left_column"><?php echo t('Description');?></span>
	<span class = "middle_column"> : </span>
	<span class = "right_column"><?php  echo get_value($node->field_scheme_description['und'][0]['value']); ?></span>
	<div class="clr"></div>
</div>

<?php if(($node->field_scheme_type['und'][0]['value']=='Downloadable') || ($node->field_scheme_type[0]['value']=='Online-Available'))
		{
          
				?>
    <div class = "node_viewlist_odd">
	 <span class = "left_column"><?php echo t('Scheme Type');?></span>
	<span class = "middle_column"> : </span>
	<span class = "right_column"><?php print $node->field_scheme_type['und'][0]['value'];   ?></span>
	<div class="clr"></div>
    </div>
    <?php
	    }
		if($node->field_scheme_type['und'][0]['value']=='Online-Available')
					{
					?>
   <div class = "node_viewlist_odd">
	<span class = "left_column"><?php echo t('Reference URL');?></span>
	<span class = "middle_column"> : </span>
	<span class = "right_column">
		<?php $filepath=$node->field_scheme_reference_url[0]['view'];?>
	<a href='javascript:void(0);' onClick='return tnportal_ext_window("<?php echo $filepath;?>");'><?php echo $filepath;?></a>
	</span>
	<div class="clr"></div>
</div>
<?php
}
if($node->field_scheme_type['und'][0]['value']=='Downloadable')
					{
					?>
<div class = "node_viewlist_odd">
	<span class = "left_column"><span class="whitespace"></span><?php echo t('Uploaded File');?> </span>
	<span class = "middle_column"> : </span>
	<span class = "right_column">
	  
	
		<?php  $fileload=$node->field_scheme_upload['und'][0]['filename']; 
			$ext_links = $node->field_scheme_upload['und'][0]['filepath'];
		
			//echo $op = "<a href='javascript:void(0);' onClick='return tnportal_window(\"$ext_links\");'>".$fileload."</a>";
		?>	
	
	<a href='javascript:void(0);' onClick='return tnportal_window("<?php echo $ext_links;?>");'><?php echo $fileload;?></a>
	</span>
	<div class="clr"></div>
</div>

<?php
}
?>



<!--<div class = "node_viewlist_odd">
	<span class = "left_column">Keywords</span>
	<span class = "middle_column"> : </span>
	<span class = "right_column"><?php //print get_value($node->field_scheme_keywords[0]['view']);   ?></span>
	<div class="clr"></div>
</div>-->

<div class ="node_view_bottom">
	<div class ="node_view_bottom_content">
		<img height="15" width="15" style="display: none;" class="node_view_bottom_corner" alt="" src=<?php print $link . "/images/bottomleft.jpg" ?>> 
	</div>
</div>

  <div class="clear-block">
    <div class="meta">
	

	
    </div>

    <?php if ($links): ?>
      <div class="links"><?php print $links; ?></div>
    <?php endif; ?>
  </div>

</div>
<?php //print_r($node);?>